<template>
	<view> 
		<view class="order-row">
			<view class="order-view">
				<view class="order-model" :data-index='index' v-for="(item, index) in orderList" :key="index" @click="selectChange(item)" :class="[currentIndex == index ? 'text-red' : 'text-black']">
					<view class="juan-text">{{ item.name }}</view>
					<view class="juan-img" v-if="item.img == true && currentIndex != index">
						<view class="up-unselect"></view>
						<view class="down-unselect"></view>
					</view>
					<view class="juan-img" v-else-if="item.img == true && currentIndex == index && (activeIndex == 0 || activeIndex == 2)">
						<view class="up-select"></view>
						<view class="down-unselect"></view>
					</view>
					<view class="juan-img" v-else-if="item.img == true && currentIndex == index && (activeIndex == 0 || activeIndex == 1)">
						<view class="up-unselect"></view>
						<view class="down-select"></view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		orderList: Array,
		activeIndex: Number,
		currentIndex: Number
	},
	methods: {
		selectChange(e) {
			this.$emit('selectChange', e);
		}
	}
};
</script>

<style lang="scss">
.order-row {
	width: 100%;
	height: 70px;
	font-size: 30px;
	font-family: 'Courier New', Courier, monospace;
	background-color: #f2f2f2;
	display: flex;
	align-items: center;
	.order-view {
		/* width: 90%; */
		width: 100%;
		min-width: 750px;
		height: 35px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		align-items: center;
		/* padding-left: 5%; */
		.text-red {
			color: #ff4964;
		}
		.text-black {
			color: #181818;
		}
		.order-model {
			width: 30%;
			height: 35px;
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			.juan-img {
				display: flex;
				flex-direction: column;
				.up-unselect {
					width: 25px;
					height: 25px;
					background: url('../../static/img/detail/upward-block.png') no-repeat;
					background-size: 100% 100%;
				}
				.down-unselect {
					width: 25px;
					height: 25px;
					background: url('../../static/img/detail/down-block.png') no-repeat;
					background-size: 100% 100%;
				}

				.up-select {
					width: 25px;
					height: 25px;
					background: url('../../static/img/detail/upward-red.png') no-repeat;
					background-size: 100% 100%;
				}
				.down-select {
					width: 25px;
					height: 25px;
					background: url('../../static/img/detail/down-red.png') no-repeat;
					background-size: 100% 100%;
				}
			}
		}
	}
}
</style>
